package dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.zx.theline.R;

import GsonBean.CheckPlanBean;
import base.BaseDialog;

/**
 * Created by renkequan on 2017/3/21.
 */
//编辑监护人dialog
public class EditorGuardianDialog extends BaseDialog {

    TextView queding;
    TextView quxiao;
    TextView add;
    //动态添加编辑监护人view的容器；
    LinearLayout bjjhr;
    CheckPlanBean.RowsBean mRowsBean;

    public EditorGuardianDialog(Context context,CheckPlanBean.RowsBean mRowsBean) {
        super(context);
        this.mRowsBean=mRowsBean;

    }

    public EditorGuardianDialog(Context context, int themeResId) {
        super(context, themeResId);
        this.mRowsBean=mRowsBean;
    }

    protected EditorGuardianDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_editorguardian);
        InitView();
        InitListen();
    }

    @Override
    protected void InitView() {
        queding = (TextView) findViewById(R.id.queding);
        quxiao = (TextView) findViewById(R.id.quxiao);
        bjjhr= (LinearLayout) findViewById(R.id.bjjhr);
        add= (TextView) findViewById(R.id.add);
    }

    @Override
    protected void InitListen() {
        queding.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              View view=View.inflate(getContext(),R.layout.bjjhr,null);
                bjjhr.addView(view);
            }
        });
        quxiao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

        add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                View view=View.inflate(getContext(),R.layout.bjjhr,null);
                bjjhr.addView(view);
            }
        });
    }

}
